home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************
-
- Think Put Lib 1.0.1
-
-
- Written by P. Stadelmann, August 1994.
-
- Use this set of routines to display formated output in dcmds.
-
- This was written because the put.o library wouldn't link in
- Think C. Some routines have the same name as routines defined
- in put.h. However, they are not functionnaly equivalent, as
- the implementation is different.
-
- All these routines use an internal storage area of 255 bytes
- to hold the text of the next line to display. The data you
- pass to a routine is appended at the end of the line.
- A internal variable keeps track of the length of the line.
- Once the length reaches 255 character, nothing else is added.
-
- When you call PutLine, the line is displayed, and the internal
- buffer is cleared. You can also clear it at any time by calling
- PutClear. This may be useful if you encounter an error.
-
- Decimal numbers are displayed with a leading '#'. Binary numbers
- are displayed in groups of 4 (1-4 for the first group) bits with
- a leading '~'.
-
- This library uses global variables. Thus, it requires SetUpA4.
-
- This library doesn't call any Toolbox routine.
-
- ******************************************************************/
-
-
- #ifndef __ThinkPut__
- #define __ThinkPut__
-
-
- void PutClear();
- /* Clear the content of the internal buffer */
-
- void PutLine();
- /* Displays the content of the internal buffer, and also clear it.
- If the buffer is empty, draws a blank line. */
-
- void PutChar(char c);
- /* Appends the character c */
-
- void PutSpace();
- /* Appends a space */
-
- void PutSpacesTo(int endpos);
- /* Appends spaces until the end of the line reaches the column endpos */
-
- void PutText(const char* s, int len );
- /* Appends len characters starting at addres s */
-
- void PutTextTo(const char* s, int len, int endpos);
- /* Appends len char starting at s and pad with spaces to reach endpos.
- If the text extend past endpos, it is truncated to fit. In this case,
- the caracter displayed at endpos will be "…". */
-
- void PutCStr(const char* s);
- /* Appends the null-terminated string starting at address s */
-
- void PutCStrTo(const char* s, int endpos);
- /* Appends the null-terminated string at s and pad with spaces to reach endpos.
- If the string extend past endpos, it is truncated to fit. In this case,
- the caracter displayed at endpos will be "…". */
-
- void PutPStr(const unsigned char* s);
- /* Same as PutCStr but for a pascal string */
-
- void PutPStrTo(const unsigned char* s, int endpos);
- /* Same as PutCStrTo but for a pascal string */
-
- void PutUHexLong (unsigned long i, int nz);
- /* Appends the unsigned long number i in hexadecimal, with nz digits displayed. */
-
- void PutUHexWord(unsigned short h);
- /* Appends the unsigned short number i in hexadecimal, with 4 digits displayed. */
-
- void PutUDec(unsigned long i);
- /* Appends the unsigned long number i as a decimal number. */
-
- void PutUDecTo(unsigned long i, int endpos);
- /* Appends the unsigned long number i as a decimal number ending at endpos. */
-
- void PutSDec(signed long i);
- /* Appends the signed long number i as a decimal number. */
-
- void PutSDecTo(signed long i, int endpos);
- /* Appends the signed long number i as a decimal number ending at endpos. */
-
- void PutBinary(unsigned long i, int nz);
- /* Appends the unsigned long number i in binary, with nz digits displayed. */
-
- void PutOSType(unsigned long typ);
- /* Appends the long number typ as an OSType. */
-
-
- #endif